home *** CD-ROM | disk | FTP | other *** search
/ NOVA - For the NeXT Workstation / NOVA - For the NeXT Workstation.iso / Documents / NeXTAnswers / postscript.292 < prev    next >
Text File  |  1992-02-06  |  2KB  |  53 lines

  1. {\rtf0\ansi{\fonttbl\f1\fnil Times-Roman;\f2\fmodern Courier;\f0\fswiss Helvetica;}
  2. \paperw13040
  3. \paperh8160
  4. \margl120
  5. \margr120
  6. \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\f1\b0\i0\ul0\fs28 PostScript PS images\
  7. \
  8. Q:  I have a LANDSAT image of Washington DC, and I'd like to see how it looks on the MegaPixel display.  Can anyone help me with code?  The image is 1024X1024 8-bit pixels, and the file has no header -- just 1024 bytes for line 1 followed by 1024 bytes for line 2, etc to EOF, altogether 1 Megabyte.\
  9. \
  10. Also, I suppose I would only see 2-bit pixels on the MegaPixel-display.  Or can I use the other bits of image data as well?\
  11. \
  12. A:  You can try appending a PS header on top of it and executing it in Yap. Here's a header that might work; it worked for the pictures of Neptune & Triton that were publicly available on some FTP hosts.\
  13. \
  14.  
  15. \f2\b     %!\
  16.     /scaleFactor 1 def\
  17.     /width  640 def\
  18.     /height 480 def\
  19.     /depth 8 def\
  20.     /picstr width 8 idiv string def\
  21.     /thedata\
  22.         \{ width height depth [width 0 0 height neg 0 height]\
  23.             \{ currentfile picstr readstring pop \} image\
  24.         \} def\
  25.     width scaleFactor mul height scaleFactor mul scale\
  26.     thedata\
  27.  
  28. \f1\b0 \
  29. Cut the section between the lines, save as 
  30. \b header.ps
  31. \b0 , change the width and height values (to 1024 and 1024), then append it to the front of your data file with\
  32. \
  33.     
  34. \f2\b cat header.ps yourdatafile > new.ps
  35. \f1\b0 \
  36. \
  37. Then fire Yap up, and open 
  38. \b new.ps
  39. \b0 . Once it's loaded, execute it; see what you get.\
  40. \
  41. The file 
  42. \b new.ps
  43. \b0  won't be previewable; it lacks the correct EPS header using the above cheapo segment of PostScript. But if it works through Yap, then you can worry about making it correct EPS. You can also just do a screen grab with Icon or Scene to get a TIFF file.\
  44. \
  45. To answer the second question: PostScript is pretty smart about dithering; it will not waste your 8 bits.\
  46. \
  47. QA292\
  48. \
  49. Valid for 1.0\
  50. Valid for 2.0\
  51. \
  52.  
  53.